package processor.impl;

import java.util.Comparator;
import java.util.List;
import java.util.Set;

import analyser.DataAnalyser;
import analyser.impl.DataAnalyserImpl;
import pojo.Customer;
import printer.DataPrinter;
import printer.impl.DataPrinterImpl;
import processor.DataProcessor;

public class DataProcessorImpl implements DataProcessor 
{
	private String format;
	private DataAnalyser analyser;
	private DataPrinter printer;
	
	public DataProcessorImpl(List<Customer> list,String format) {
		this.format=format;
		analyser=new DataAnalyserImpl(list);
		printer=new DataPrinterImpl();
	}
	public StringBuilder process(Comparator<Customer> comp) {
		Set<Customer> set=analyser.analyse(comp);
		
		return printer.print(set, format);
	}
}
